<?php

class UserInfo
{
    /** @var int */
    protected $id = 0;
    /** @var string */
    protected $real_name = null;
    /** @var int */
    protected $sex = null;
    /** @var string */
    protected $prov = null;
    /** @var string */
    protected $city = null;
    /** @var string */
    protected $dist = null;
    /** @var int */
    protected $DefaultContactType = null;
    /** @var string */
    protected $phone = null;
    /** @var string */
    protected $phone_short = null;
    /** @var string */
    protected $qq = null;
    /** @var string */
    protected $profile = null;
    /** @var string */
    protected $avatar_hash = null;
    /** @var string */
    protected $birthday = null;

    /** @var int */
    protected $userId = 0;

    public function getDisplayRealName()
    {
        $thatUser = User_Model::getUserById($this->getUserId());
        if ($thatUser && $thatUser->getId() > 0) {
            $thatStudentInfo = $thatUser->getStudentInfo();
            if ($thatStudentInfo && $thatStudentInfo->getId() > 0) {
                return $thatStudentInfo->getStudentName();
            }
            return $this->getRealName();
        }
        return $this->getRealName();
    }

    /**
     * @return array
     */
    public function getDataArray()
    {
        return array(
            'id'          => $this->getId(),
            'real_name'   => $this->getRealName(),
            'sex'         => $this->getSex(),
            'prov'        => $this->getProv(),
            'city'        => $this->getCity(),
            'dist'        => $this->getDist(),
            'phone'       => $this->getPhone(),
            'qq'          => $this->getQq(),
            'profile'     => $this->getProfile(),
            'avatar_hash' => $this->getAvatarHash(),
            'user_id'     => $this->getUserId(),
            'phone_short' =>$this->getPhoneShort(),
            'birthday    '=>$this->getBirthday(),
            'DefaultContactType'=>$this->getDefaultContactType(),
        );
    }

    /**
     * @return int
     */
    public function getDefaultContactType()
    {
        return $this->DefaultContactType;
    }

    /**
     * @param int $DefaultContactType
     */
    public function setDefaultContactType($DefaultContactType)
    {
        $this->DefaultContactType = $DefaultContactType;
    }
    /**
     * @return string
     */
    public function getPhoneShort()
    {
        return $this->phone_short;
    }

    /**
     * @param string $phone_short
     */
    public function setPhoneShort($phone_short)
    {
        $this->phone_short = $phone_short;
    }

    /**
     * @param string $avatar_hash
     */
    public function setAvatarHash($avatar_hash)
    {
        $this->avatar_hash = $avatar_hash;
    }

    /**
     * @return string
     */
    public function getAvatarHash()
    {
        return $this->avatar_hash;
    }

    /**
     * @param string $city
     */
    public function setCity($city)
    {
        $this->city = $city;
    }

    /**
     * @return string
     */
    public function getCity()
    {
        return $this->city;
    }

    /**
     * @param int $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param string $phone
     */
    public function setPhone($phone)
    {
        $this->phone = $phone;
    }

    /**
     * @return string
     */
    public function getPhone()
    {
        return $this->phone;
    }

    /**
     * @param string $profile
     */
    public function setProfile($profile)
    {
        $this->profile = $profile;
    }

    /**
     * @return string
     */
    public function getProfile()
    {
        return $this->profile;
    }

    /**
     * @param string $qq
     */
    public function setQq($qq)
    {
        $this->qq = $qq;
    }

    /**
     * @return string
     */
    public function getQq()
    {
        return $this->qq;
    }

    /**
     * @param string $real_name
     */
    public function setRealName($real_name)
    {
        $this->real_name = $real_name;
    }

    /**
     * @return string
     */
    public function getRealName()
    {
        return $this->real_name;
    }

    /**
     * @param int $sex
     */
    public function setSex($sex)
    {
        $this->sex = $sex;
    }

    /**
     * @return int
     */
    public function getSex()
    {
        return $this->sex;
    }

    /**
     * @param int $userId
     */
    public function setUserId($userId)
    {
        $this->userId = $userId;
    }

    /**
     * @return int
     */
    public function getUserId()
    {
        return $this->userId;
    }
    /**
     * @return string
     */
    public function getDist()
    {
        return $this->dist;
    }

    /**
     * @param string $dist
     */
    public function setDist($dist)
    {
        $this->dist = $dist;
    }

    /**
     * @return string
     */
    public function getProv()
    {
        return $this->prov;
    }

    /**
     * @param string $prov
     */
    public function setProv($prov)
    {
        $this->prov = $prov;
    }
    /**
     * @return string
     */
    public function getBirthday()
    {
        return $this->birthday;
    }

    /**
     * @param string $birthday
     */
    public function setBirthday($birthday)
    {
        $this->birthday = $birthday;
    }

}